package com.goodfox.web.generic.provide.exception;

import org.apache.log4j.Logger;

public class EntityValidateException extends Exception {

	/** log4j日志器 */
	private Logger logger=Logger.getLogger(EntityValidateException.class);
	
	private static final long serialVersionUID = -1418335318912972789L;
	
	/** 异常类型 */
	private EntityExpType expType;
	/** 异常描述 */
	private String expDesc;
	
	public EntityValidateException(EntityExpType expType,String expDesc){
		this.expType=expType;
		this.expDesc=expDesc;
	}

	@Override
	public String getMessage() {
		StringBuilder sbMsg=new StringBuilder();
		sbMsg.append("[").append(expDesc).append("]").append(expType.getName());
		logger.debug(sbMsg.toString());
		return sbMsg.toString();
	}
	

}
